from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
import pandas as pd
import json

# Create your views here.
def test(request):
    return HttpResponse('Hello world')

def getdata(request):
    with open('datapad/staticfiles/data.json', 'r') as fileptr:
        data = json.load(fileptr)
    response = JsonResponse(data)
    return response

# {
#     "data": [300, 280, 250, 260, 270, 290, 300, 550, 500, 400, 390, 380, 400, 500, 600, 700, 750, 800, 700, 600, 400, 370, 380, 390],
#     "time": ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"]
# }